SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].[usp_ShowSurveys]

	(
	@param_now SMALLDATETIME

	)

AS
	/* SET NOCOUNT ON */
	
	SELECT * FROM dbo.JOL_SurveyManagement_Theme 
	WHERE 
--	start_time<=@param_now AND 	end_time>=@param_now AND 
	id IN(SELECT DISTINCT survey FROM dbo.JOL_SurveyManagement_Items)
	ORDER BY
	dbo.JOL_SurveyManagement_Theme.start_time DESC
	RETURN

GO
